<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>微学习</title>

    <div th:include="template::commonlink"></div>

    <link rel="stylesheet" type="text/css" href="/css/index.css"/>

    <link rel="stylesheet" href="/plugins/dropload/dropload.css">
    <script src="/plugins/dropload/dropload.min.js"></script>
</head>
<body>
<div th:include="template::header"></div>

<div th:include="template::catalog"></div>
<script>
    $("#subject_nav").addClass("active")
</script>

<style>
    .data-content .content { /*强制文本在一行内显示*/
        /*white-space:nowrap;*/
        width: 90% !important;
        /*溢出内容为隐藏*/
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
        /*-moz-binding:url('ellipsis.xml#ellipsis');*/
        padding: 20px;
        margin: 10px 5px;
    }

    .article-item {
        margin-top: 20px;
    }

    .article-item .content {
        line-height: 20px;
        max-height: 200px;
    }

    .article-item .content {
        /*溢出内容为隐藏*/
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }

    .content p {
        margin-bottom: 20px !important;
    }

    .data-content h1 {
        color: #29B4F0;
        text-decoration: none;
        font-size: 30px;
    }

    .node-header {
        font-size: 15px;
        color: #ccc;
    }

</style>
<div class="d-flex flex-row" style="background-color: #eeeeee">
    <div style="flex:7; width:70%; ">

        <div class="title d-flex p-3 m-3 bg-light">
            <span th:text="${grade.grade_name}"></span> / <span th:text="${subject.subject_name}"></span>
        </div>

        <div id="articles" class="d-flex p-3 m-3 bg-light">


            <div class="data-content" style="padding:0 10px; margin-top:-20px;">
                <div v-for="article in articles" class="article-item card p-2">
                    <h1 class="">{{article.article_title}}</h1>
                    <div class="d-flex node-header">
                        <div>
                            <span>作者：{{article.author.te_name}}</span>&nbsp;&nbsp;
                            <span>日期：{{article.releaseTime}}</span>&nbsp;&nbsp;
                            <span class="icon"> &#xe662; {{article.article_zan}}</span>&nbsp;&nbsp;
                            <span class="icon"> &#xe71b; {{article.article_read_count}}</span>
                        </div>
                    </div>

                    <div class="card-body">
                        <div class="content" v-html="article.article_content"></div>

                        <a v-bind:href="'/article/detail?id='+article.article_id" class="card-link">阅读全文</a>
                    </div>


                </div>
            </div>
        </div>
    </div>

    <!--<%@include file="/WEB-INF/views/linkNav.jsp"%>-->
    <div th:include="template::navlink"></div>

</div>
<!--<%@include file="/WEB-INF/views/footer.jsp"%>-->
<div th:include="template::footer"></div>
</body>

<span id="subjectId" style="display: none;" th:value="${subject.subject_id}"></span>
<span id="gradeId" style="display: none;" th:value="${grade.grade_id}"></span>
<script>
    subjectId = $('#subjectId').val();
    gradeId = $('#gradeId').val();
</script>
<script src="/js/catalog/index.js"></script>
</html>
